import { Md5 } from "ts-md5";
import HTTP from "../utils/request";

const md5 = new Md5();
export default {
  login(userName: string, password: string) {
    const salt = new Date().getTime();
    md5.start();
    md5.appendStr(password + salt);
    return HTTP.post(`/auth/login?timestamp=${salt}`, {
      userName,
      password: md5.end(),
    });
  },
  //   logout() {
  //     return baseService.get("/auth/logout");
  //   },
  healthyCheck() {
    return HTTP.head(`/auth/login`);
  },
  //   test() {
  //     return baseService.get("/auth/test");
  //   },
  socketIoPort() {
    return HTTP.get("/auth/socketio");
  },
};
